package org.cqepc.project.reform.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.cqepc.project.reform.model.entity.SubjectEntity;
import org.cqepc.project.reform.service.SubjectService;
import org.cqepc.project.reform.mapper.SubjectMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
* @author 张鹏
* @description 针对表【reform_subject】的数据库操作Service实现
* @createDate 2025-05-14 20:31:12
*/
@Service
public class SubjectServiceImpl extends ServiceImpl<SubjectMapper, SubjectEntity>
    implements SubjectService{

    @Autowired
    SubjectMapper subjectMapper;

    @Override
    public Integer insertSubject(SubjectEntity subject) {
        return subjectMapper.insert(subject);
    }

    @Override
    public List<SubjectEntity> getAllSubjects() {
        return subjectMapper.selectList(null);
    }

    @Override
    public Integer deleteSubject(SubjectEntity subject) {
        return subjectMapper.deleteById(subject);
    }

    @Override
    public Integer updateSubject(SubjectEntity subject) {
        return subjectMapper.updateById(subject);
    }

    @Override
    public SubjectEntity getSubjectById(String id) {
        return subjectMapper.selectById(id);
    }

    @Override
    public String getMaxRoundCode() {
        return subjectMapper.getMaxRoundCode();
    }
}




